package org.jaaksi.demo.ptr.ui.base;

import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import org.jaaksi.demo.ptr.widegit.LoadingBar;

/**
 * Created by Fcy on 2016/3/19.<br/>
 */
public class BaseActivity extends FragmentActivity
{
	// 不抢占焦点，不要在多个切换的fragment中使用
	protected LoadingBar mLoadingBar;
	// 占据焦点
//	protected MyProgressBar mProgressBar;

	protected Handler mHandler = new Handler();

	@Override
	protected void onCreate(@Nullable Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		mLoadingBar = new LoadingBar(this);

	}

	@Override
	protected void onDestroy()
	{
		if (mLoadingBar != null)
		{
			mLoadingBar.dismiss();
		}
		super.onDestroy();
	}

	protected <T extends View> T findViewByIdExt(int resId)
	{
		return (T) findViewById(resId);
	}
}
